const obj = {
    name: '蜗牛',
    age: 19,
    gender: '男'
}

// 把对象转成数组
// const res = Object.entries(obj)  // [ [ 'name', '蜗牛' ], [ 'age', 19 ], [ 'gender', '男' ] ]
// console.log(res);

Object.prototype.my_entries = function(obj) {
    const res = []
    for (let key in obj) {
        obj.hasOwnProperty(key) && res.push([key, obj[key]])
    }
    return res
}
const res = Object.my_entries(obj)
console.log(res);


